package com.hkd.common.api.enums;

/**
 * @author HKD
 * @date 2022/9/18 23:47
 */
public enum PaymentMethod {
    //现金
    CASH(1),
    //余额
    BALANCE(2),
    //网银
    ONLINE(3),
    //支付宝
    ZFB(4),
    //微信
    WX(5)
    ;

    private Integer code;

    PaymentMethod(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    public static PaymentMethod search(Integer code){
        for (PaymentMethod value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
